import random


class Solution(object):

    def __init__(self, m, n):
        """
        :type m: int
        :type n: int
        """
        self.m = m
        self.n = n
        self.already = set()

    def flip(self):
        """
        :rtype: List[int]
        """
        while True:
            i = random.randint(0, self.m - 1)
            j = random.randint(0, self.n - 1)
            if (i, j) not in self.already:
                break
        self.already.add((i, j))
        return [i, j]

    def reset(self):
        """
        :rtype: None
        """
        self.already = set()
